/* 基础样式 */
:root {
  --primary-color: #3498db;
  --secondary-color: #2ecc71;
  --danger-color: #e74c3c;
  --warning-color: #f39c12;
  --dark-color: #34495e;
  --light-color: #ecf0f1;
  --text-color: #2c3e50;
  --sidebar-width: 250px;
}

body {
  font-family: 'Nunito', sans-serif;
  color: var(--text-color);
  background-color: #f8f9fa;
  margin: 0;
  padding: 0;
}

/* 侧边栏样式 */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--dark-color);
  color: white;
  padding-top: 20px;
  transition: all 0.3s;
  z-index: 1000;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar-header {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h3 {
  margin: 0;
  font-weight: 700;
}

.sidebar-menu {
  padding: 20px 0;
  list-style: none;
}

.sidebar-menu li {
  margin-bottom: 5px;
}

.sidebar-menu li a {
  display: block;
  padding: 12px 20px;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: all 0.3s;
  font-size: 15px;
}

.sidebar-menu li a:hover {
  background-color: rgba(255,255,255,0.1);
  color: white;
}

.sidebar-menu li a.active {
  background-color: var(--primary-color);
  color: white;
  border-left: 4px solid white;
}

.sidebar-menu .menu-heading {
  padding: 10px 20px;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  letter-spacing: 1px;
  margin-top: 15px;
}

/* 主内容区域 */
.content {
  margin-left: var(--sidebar-width);
  padding: 20px;
  min-height: 100vh;
  transition: all 0.3s;
}

/* 卡片样式 */
.card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-header {
  padding: 15px 20px;
  background-color: white;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-body {
  padding: 20px;
}

/* 表格样式 */
.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th, .data-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.data-table th {
  font-weight: 600;
  background-color: rgba(0,0,0,0.02);
}

.data-table tbody tr:hover {
  background-color: rgba(0,0,0,0.01);
}

/* 按钮样式 */
.btn {
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background-color: #27ae60;
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background-color: #c0392b;
}

/* 表单样式 */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.form-control {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.form-control:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.25);
}

/* 徽章样式 */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
}

.badge-primary {
  background-color: var(--primary-color);
  color: white;
}

.badge-success {
  background-color: var(--secondary-color);
  color: white;
}

.badge-danger {
  background-color: var(--danger-color);
  color: white;
}

.badge-warning {
  background-color: var(--warning-color);
  color: white;
}

/* 加载动画 */
.loader {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid rgba(0,0,0,0.1);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .sidebar {
    width: 0;
    padding: 0;
  }

  .content {
    margin-left: 0;
  }

  .sidebar.active {
    width: var(--sidebar-width);
    padding-top: 20px;
  }

  .content.shifted {
    margin-left: var(--sidebar-width);
  }

  .menu-toggle {
    display: block;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1100;
  }
}

/* 弹出框样式 */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-container {
  background-color: white;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid rgba(0,0,0,0.05);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 统计卡片样式 */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
}

.stat-card-title {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.stat-card-value {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 5px;
}

.stat-card-change {
  font-size: 12px;
  display: flex;
  align-items: center;
}

.positive-change {
  color: var(--secondary-color);
}

.negative-change {
  color: var(--danger-color);
}

/* 压力级别指示器 */
.pressure-indicator {
  display: inline-block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  margin-right: 5px;
}

.pressure-low {
  background-color: var(--secondary-color);
}

.pressure-medium {
  background-color: var(--warning-color);
}

.pressure-high {
  background-color: var(--danger-color);
}

/* 提示消息 */
.alert {
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.alert-success {
  background-color: rgba(46, 204, 113, 0.1);
  color: #27ae60;
  border-left: 4px solid #27ae60;
}

.alert-danger {
  background-color: rgba(231, 76, 60, 0.1);
  color: #c0392b;
  border-left: 4px solid #c0392b;
}

.alert-warning {
  background-color: rgba(243, 156, 18, 0.1);
  color: #d35400;
  border-left: 4px solid #d35400;
}

.alert-info {
  background-color: rgba(52, 152, 219, 0.1);
  color: #2980b9;
  border-left: 4px solid #2980b9;
}
